﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// Reviewed
#pragma once

#include "IEvent.h"

namespace gcmp
{
    class IDocument;
    class IAutoSaveEventHandler;

    /// \brief  文档事件
    ///
    class IAutoSaveEvent : public IEvent
    {
        DEFINE_CAST_DERIVED(gcmp::IAutoSaveEvent, gcmp::IEvent);
    public:

        ///  \brief  添加文档事件处理者
        ///
        /// \param pHandler  文档事件处理者
        /// \return  添加成功返回true，否则返回false
        virtual bool Add(IAutoSaveEventHandler* pHandler) = 0;

        ///  \brief  删除文档事件处理者
        ///
        /// \param pHandler  文档事件处理者
        /// \return  删除成功返回true，否则返回false
        virtual bool Delete(IAutoSaveEventHandler* pHandler) = 0;

        ///  \brief  获取文档事件发送者
        ///
        /// \return  文档管理者
        virtual IDocument* GetSender() const = 0;
    };
}
